package com.lhc.singleton;

public class Student {

    //成员变量
    private String stuName;
    private String  stuSex;
    private int stuAge;
    //方法


    public Student(String stuName, String stuSex, int stuAge) {
        this.stuName = stuName;
        this.stuSex = stuSex;
        this.stuAge = stuAge;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public String getStuSex() {
        return stuSex;
    }

    public void setStuSex(String stuSex) {
        this.stuSex = stuSex;
    }

    public int getStuAge() {
        return stuAge;
    }

    public void setStuAge(int stuAge) {
        this.stuAge = stuAge;
    }

    @Override
    //判断学生的内容是否相同

    public boolean equals(Object obj) {
        if(this==obj)
            return true;
        if(obj==null)return false;
        if(obj instanceof Student) {
            Student stu=(Student)obj;
            if (this.stuName == stu.stuName &&this.stuName!=null
                    && this.stuAge == stu.stuAge
                    &&this.stuSex == stu.stuSex&&this.stuSex!=null)
            return true;
        }
        return false;
    }

    public void doStuding()
    {
        System.out.println("I am studying.....");
    }


}
